package com.shenzhenai.it_hei_ma.a03threadcase3;

import java.util.concurrent.Callable;

/**
 * @author huangzehui
 * @date 2025/8/26 13:50 周二
 * @description Callable<T>: T 表示返回值的类型
 */
public class MyCallable implements Callable<Integer> {
    @Override
    public Integer call() throws Exception {
        // 求1~100之间的和
        int sum = 0;
        for (int i = 0; i <= 100; i++) {
            sum += i;
        }
        return sum;
    }
}
